IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[GetArraEmailNotificationStatus]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
BEGIN
	DROP PROCEDURE dbo.GetArraEmailNotificationStatus
END
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO


/******************************************************************
*  Name:  GetArraNotificationDateByPIQuestionnaireId
* Purpose: To get the status of the ArraEmail Notification.
*
* PARAMETERS
* Name    			Description					
* -------------  	-------------------------------------------
* @AdmPersonId      AdmPerosnId
* @EmailType		Email Type
******************************************************************/
CREATE PROCEDURE [dbo].[GetArraEmailNotificationStatus]     
(
	@AdmPersonId INT,
	@EmailType VARCHAR(2),
	@ReportingPeriodId INT
)
AS
BEGIN

	SELECT Status
	FROM 
		ArraEmailNotificationStatus
	WHERE
		AdmPersonId = @AdmPersonId
		AND 
		EmailType = @EmailType
		AND
		ReportingPeriodId = @ReportingPeriodId
END


--Exec dbo.GetArraEmailNotificationStatus 2853,'RE'

